package com.codejam.hello.world.controller;

import com.codejam.hello.world.conf.TestConfBean;
import com.codejam.hello.world.conf.factory.Car;
import com.codejam.hello.world.conf.imports.ImportTestBean;
import com.codejam.hello.world.conf.scope.TestScopeBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.support.XmlWebApplicationContext;

@RequestMapping("/conf")
@RestController
public class ConfController {


    @Autowired
    private TestConfBean confBean;


    @Autowired
    private ImportTestBean importTestBean;


    @Autowired
    private TestScopeBean testScopeBean;


    @Autowired
    private Car car;


    @PostMapping(value = "/test1")
    public void test1() {

        int i = confBean.hashCode();

        int a = 0;
    }


    @GetMapping(value = "/test2")
    public void test2() {

        int i = importTestBean.hashCode();

        int a = 0;
    }

    @GetMapping(value = "/test3")
    public void test3() {

        int a = 0;
    }

    @GetMapping(value = "/test4")
    public void test4() {
        Car car = this.car;
        int a = 0;
    }
}
